﻿using System.Runtime.InteropServices;

namespace OdsServer.Common.Packet
{
    [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
    public unsafe struct SingleChannelDataPacket : IBasePacket
    {
        internal PacketHeader header;
        internal long timespan;
        internal ushort value;

        public SingleChannelDataPacket(long t, ushort val)
        {
            this.header.type    = PacketType.SingleChannelDataPacket;
            this.header.lenght  = sizeof(SingleChannelDataPacket);

            this.timespan   = t;
            this.value      = val;
        }

        public long GetTimespan()
        {
            return this.timespan;
        }

        public ushort GetValue()
        {
            return this.value;
        }

        public PacketHeader GetHeader()
        {
            return this.header;
        }
    }
}
